package org.tech4j.common.core.model.page;

import java.util.Optional;

/**
 * @program: tech4j-common
 * @description:
 * @author: YuKai Fan
 * @create: 2025/3/1 21:08
 **/
public class OffsetQuery {
    private final static int DEFAULT_OFFSET = 0;
    private final static int DEFAULT_LIMIT = 10;


    private Integer offset;

    private Integer limit;

    public Integer getOffset() {
        return Optional.ofNullable(offset).orElse(DEFAULT_OFFSET);
    }

    public void setOffset(Integer offset) {
        this.offset = offset;
    }

    public Integer getLimit() {
        return Optional.ofNullable(limit).orElse(DEFAULT_LIMIT);
    }

    public void setLimit(Integer limit) {
        this.limit = limit;
    }
}
